#include "term.h"

term::term(void)
{
}

term::~term(void)
{
}

term::term(unsigned int c, unsigned int e)
{
	coef = c;
	exp = e;
}

void term::setCoef(unsigned int c)
{
	coef = c;
}

void term::setExp(unsigned int e)
{
	exp = e;
}


term operator * (term &t1, term &t2)
{
	term t(t1.coef * t2.coef, t1.exp + t2.exp);
	return t;
}

bool operator == (term &t1, term &t2)
{
	if (t1.coef == t2.coef && t1.exp == t2.exp)
		return true;
	return false;
}

bool operator != (term &t1, term &t2)
{
	if (t1.coef == t2.coef && t1.exp == t2.exp)
		return false;
	return true;
}

void term::modulo(unsigned int n, unsigned int r)
{
	coef %= n;
	exp %= r;
}